<template>
  <div class="categotries">
    <template v-for="(item, idx) in categories" :key="idx">
      <div class="category-cell">
        <img :src="item.pictureUrl" alt="">
        <div class="text">{{ item.title }}</div>
      </div>
    </template>
  </div>
</template>

<script setup>
import { useHomeStore } from '@/store/modules/home';
import { storeToRefs } from 'pinia';
const homeStore = useHomeStore()

const { categories } = storeToRefs(homeStore)
</script>

<style lang="less" scoped>
.categotries {
  display: flex;
  overflow-x: auto;
  height: 21.33333vw;
  padding: 0 2.66667vw;

  &::-webkit-scrollbar {
    display: none;
  }

  .category-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    width: 18.66667vw;
    flex-shrink: 0;


    img {
      width: 8.53333vw;
      height: 8.53333vw;
    }

    .text {
      font-size: 3.2vw;
      margin-top: 2.13333vw;
    }
  }
}
</style>